<include file="App/Admin/View/Public/left.html"/>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/kindeditor.js"></script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/lang/zh_CN.js"></script>
	<script type="text/javascript" charset="utf-8" src="__PUBLIC__/kindeditor/plugins/prettify.js"></script>
<div class="admin">
<div class="panel admin-panel margin-top" id="add">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span>产品添加 </strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U('Product/add')}" enctype="multipart/form-data">  
		
		<input type="hidden" name="id" value="{$product.id}">
		
	
		<notempty name="product.pic">
			<div class="form-group">
			<div class="label">
			  <label>文章图片：</label>
			</div>
			<div class="field">
				<img style="width: 300px;height: 150px;border-radius: 15px;border: 1px solid;" src="{$product.pic}"><input type="hidden" name="pic" value="{$product.pic}" class="common-text" />
				<input type="hidden" value="{$product['pic']}" name="pic_1" />
			</div>
		  </div> 
		</notempty>
	
		<div class="form-group">
        <div class="label">
          <label>文章图片：</label>
        </div>
        <div class="field">
			<a class="button input-file bg-blue margin-left" href="javascript:void(0);">+ 上传文章图片<input size="100" type="file" name="Filedata"  /></a>
        </div> 
	   <div class="form-group">
        <div class="label">
          <label>产品名称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$product.title}" name="title" data-validate="required:请输入产品名称" />
          <div class="tips"></div>
        </div>
		 </div>
		<div class="form-group">
        <div class="label">
          <label>关键词：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$product.keywords}" name="keywords" data-validate="required:请输入关键期" />
          <div class="tips"></div>
        </div>
		 </div>
	  <div class="form-group">
        <div class="label">
          <label>分类级别：</label>
        </div>
        <div class="field">
		  <select name="tid" id="tid"  class="input input-auto">
			<volist name="list" id="vo">
				<option value="{$vo.tid}" <eq name="re.tid" value="$vo.tid">selected="selected"</eq>>__{$vo.tname}</option>
					<!--<option value="{$vo.tid}">{$vo.tname}</option>-->
				<volist name="vo.children" id="voo">
					<option value="{$voo.tid}" <eq name="re.tid" value="$voo.tid">selected="selected"</eq>>____{$voo.tname}</option>
					<!--<option value="{$voo.tid}">____{$voo.tname}</option>-->
				</volist>
			</volist>
		  </select>
          <div class="tips"></div>
        </div>
      </div>
	  <div class="form-group">
        <div class="label">
          <label>显示位置：</label>
        </div>
        <div class="field">
		  <select name="position_id" id="position_id"  class="input input-auto">
			<volist name="position" id="vo">
			<option value="{$vo.position_id}"  <eq name="product.position_id" value="$vo.position_id">selected="selected"</eq>>{$vo.name}</option>
			</volist>
		  </select>
          <div class="tips"></div>
        </div>
      </div>
      
      <div class="form-group">
        <div class="label">
          <label>产品详情：</label>
        </div>
        <div class="field">
         <div style="width:800px;">
            <!-- 加载编辑器的容器 -->
            <script id="editor" name="content" value='{$product.content}' type="text/plain"></script>
            <!-- 配置文件 -->
            <script type="text/javascript" src="__PUBLIC__/UEditor/ueditor.config.js"></script>
            <script type="text/javascript" src="__PUBLIC__/UEditor/ueditor.all.min.js"></script>
            <!-- 编辑器源码文件 -->
            <script type="text/javascript" src="__PUBLIC__/UEditor/ueditor.all.js"></script>
            <!-- 实例化编辑器 -->
            <script type="text/javascript">
                var ue = UE.getEditor('editor',{
				   initialContent:'{$product.content}',
          		//focus时自动清空初始化时的内容  
         		 autoClearinitialContent:false,  
         		 //关闭字数统计  
         		 wordCount:false,  
				//关闭elementPath  
          		elementPathEnabled:false,  
			  //默认的编辑区域高度  
			  initialFrameHeight:300  
			  //更多其他参数，请参考ueditor.config.js中的配置项  
          
        });
            </script>
        </div>

        </div>
      </div>
	  <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</div>
</div>
</body>
</html>


<script type="text/javascript">    
 function preview(file)  
 {  
 var prevDiv = document.getElementById('preview');  
 if (file.files && file.files[0])  
 {  
 var reader = new FileReader();  
 reader.onload = function(evt){  
 prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
}    
 reader.readAsDataURL(file.files[0]);  
}  
 
 }function preview1(file)  
 {  
 var prevDiv = document.getElementById('preview1');  
 if (file.files && file.files[0])  
 {  
 var reader = new FileReader();  
 reader.onload = function(evt){  
 prevDiv.innerHTML = '<img src="' + evt.target.result + '" />';  
}    
 reader.readAsDataURL(file.files[0]);  
}  
 
 }
 </script>